// McDlgGetHistoryOption.cpp : implementation file
//

#include "stdafx.h"
#include "nodeclient.h"
#include "McDlgGetHistoryOption.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// McDlgGetHistoryOption dialog


McDlgGetHistoryOption::McDlgGetHistoryOption(CWnd* pParent /*=NULL*/)
	: CDialog(McDlgGetHistoryOption::IDD, pParent)
{
	//{{AFX_DATA_INIT(McDlgGetHistoryOption)
	m_dtBeginDate = COleDateTime::GetCurrentTime();
	m_dtBeginTime = COleDateTime::GetCurrentTime();
	m_dtEndDate = COleDateTime::GetCurrentTime();
	m_dtEndTime = COleDateTime::GetCurrentTime();
	m_interval = 0;
	//}}AFX_DATA_INIT
}


void McDlgGetHistoryOption::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(McDlgGetHistoryOption)
	DDX_DateTimeCtrl(pDX, IDC_DT_END_DATE, m_dtEndDate);
	DDX_DateTimeCtrl(pDX, IDC_DT_END_TIME, m_dtEndTime);
	DDX_DateTimeCtrl(pDX, IDC_DT_START_DATE, m_dtBeginDate);
	DDX_DateTimeCtrl(pDX, IDC_DT_START_TIME, m_dtBeginTime);
	DDX_Text(pDX, IDC_EDIT1, m_interval);
	DDV_MinMaxUInt(pDX, m_interval, 0, 86400);
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(McDlgGetHistoryOption, CDialog)
	//{{AFX_MSG_MAP(McDlgGetHistoryOption)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// McDlgGetHistoryOption message handlers

BOOL McDlgGetHistoryOption::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	m_dtBeginDate -= COleDateTimeSpan(1, 0, 0, 0);
	UpdateData(FALSE);
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}

void McDlgGetHistoryOption::OnOK() 
{
	// TODO: Add extra validation here
	UpdateData(TRUE);
	CDialog::OnOK();
}
